package top.yxf.spring.aop;


import top.yxf.spring.util.ClassUtils;

/**
 * @author xs.wu
 */
public class TargetSource {

    private final Object target;


    public TargetSource(Object target) {
        this.target = target;
    }

    public Class<?>[] getTargetClass(){
        Class<?> aClass = this.target.getClass();
        aClass = ClassUtils.isCglibProxyClass(aClass) ? aClass.getSuperclass() : aClass;
        return aClass.getInterfaces();
    }

    public Object getTarget(){
        return this.target;
    }
}
